import { Layout, Menu, Row, Button } from 'antd';
import { Link } from 'react-router-dom';
import RouteView from '../router';

import './index.css';

const { Header, Sider, Content } = Layout;

export default (props) => {
    const profile = JSON.parse(window.sessionStorage.getItem('profile'));

    return (
        <Layout>
            <Sider theme="light">
                <div className="logo">
                    <span>飞书管理系统</span>
                </div>

                <Menu>
                    <Menu.Item>
                        <Link to="/admin/user">用户与部门</Link>
                    </Menu.Item>
                    <Menu.Item>
                        <Link to="/admin/role">角色</Link>
                    </Menu.Item>
                </Menu>
            </Sider>
            <Layout>
                <Header>
                    <Row justify="space-between" align="middle">
                        <span>角色</span>
                        <Button type="link">管理员</Button>
                    </Row>
                </Header>
                <Content>
                    <RouteView routes={props.routes} />
                </Content>
            </Layout>
        </Layout>
    );
};
